﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wozuji.Logic
{
    class DistinctOp
    {
        #region 得到省列表
        public string getPravince()
        {
            string rtn = "";
            List<Wozuji.Model.region_t> rgnList = new List<Model.region_t>();
            rgnList = new Wozuji.BLL.region_t().GetModelList("rtrim(region_code) like\'%0000\' order by region_code");
            for (int i = 0; i < rgnList.Count; i++)
            {
                Wozuji.Model.region_t rgt = rgnList[i];
                if ((i % 8) == 0)
                {
                    rtn = rtn + "&nbsp;&nbsp;&nbsp;&nbsp;<span class='privince'><a href='/share/cityViewList.aspx?pid=" + rgt.region_code + ">" + rgt.region_name + "</a></span>";
                }
                else
                {
                    rtn = rtn + "<br/><span class='privince'><a href='/share/cityViewList.aspx?pid=" + rgt.region_code + ">" + rgt.region_name + "</a></span>";
                }
            }
            return rtn;

        }
        #endregion

        #region 得到某个省景区

        public string getview(string privince)
        {
            string rtn = "";
            List<Wozuji.Model.Destination_t> rgnList = new List<Model.Destination_t>();
            rgnList = new Wozuji.BLL.Destination_t().GetModelList("rtrim(region)='"+privince+"'");
            for (int i = 0; i < rgnList.Count; i++)
            {
                Wozuji.Model.Destination_t rgt = rgnList[i];
                if ((i % 8) == 0)
                {
                    rtn = rtn + "&nbsp;&nbsp;&nbsp;&nbsp;<span class='privince'><a href='/share/cityViewList.aspx?pid=" + rgt.id + ">" + rgt.Name + "</a></span>";
                }
                else
                {
                    rtn = rtn + "<br/><span class='privince'><a href='/share/cityViewList.aspx?pid=" + rgt.id + ">" + rgt.Name + "</a></span>";
                }
            }
            return rtn;
        }


        #endregion
    }

}
